<%@ tag pageEncoding="UTF-8"%>
<%@ attribute name="page" required="true"
	type="cn.org.rapid_framework.page.Page" description="Page.java"%>
<%@ attribute name="pageSizeSelectList" type="java.lang.Number[]"
	required="false"%>
<%@ attribute name="isShowPageSizeList" type="java.lang.Boolean"
	required="false"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
	// set default values
	Integer[] defaultPageSizes = new Integer[] { 10, 50, 100 };
	if (jspContext.getAttribute("pageSizeSelectList") == null) {
		jspContext.setAttribute("pageSizeSelectList", defaultPageSizes);
	}

	if (jspContext.getAttribute("isShowPageSizeList") == null) {
		jspContext.setAttribute("isShowPageSizeList", true);
	}
%>
<c:choose>
	<c:when test="${page.firstPage}">
		<a href="javascript:;" title="首页">&laquo; 首页</a>
	</c:when>
	<c:otherwise>
		<a href="javascript:simpleTable.togglePage(1);" title="首页">&laquo;
			首页</a>
	</c:otherwise>
</c:choose>
<c:choose>
	<c:when test="${page.hasPreviousPage}">
		<a
			href="javascript:simpleTable.togglePage(${page.previousPageNumber});"
			title="上一页">&laquo; 上一页</a>
	</c:when>
	<c:otherwise>
		<a href="javascript:;" title="上一页">&laquo; 上一页</a>
	</c:otherwise>
</c:choose>
<c:forEach var="item" items="${page.linkPageNumbers}">
	<c:choose>
		<c:when test="${item == page.thisPageNumber}">

			<a href="javascript:;" class="number current" title="${item}">${item}</a>
		</c:when>
		<c:otherwise>
			<a href="javascript:simpleTable.togglePage(${item});" class="number"
				title="${item}">${item}</a>
		</c:otherwise>
	</c:choose>
</c:forEach>
<c:choose>
	<c:when test="${page.hasNextPage}">
		<a href="javascript:simpleTable.togglePage(${page.nextPageNumber});"
			title="下一页">下一页 &raquo;</a>
	</c:when>
	<c:otherwise>
		<a href="javascript:;" title="下一页">下一页 &raquo;</a>
	</c:otherwise>
</c:choose>
<c:choose>
	<c:when test="${page.lastPage}">
		<a href="javascript:;" title="尾页">尾页 &raquo;</a>
	</c:when>
	<c:otherwise>
		<a href="javascript:simpleTable.togglePage(${page.lastPageNumber});"
			title="尾页">尾页 &raquo;</a>
	</c:otherwise>
</c:choose>
<c:if test="${isShowPageSizeList}">
	每页<select onChange="simpleTable.togglePageSize(this.value)">
		<c:forEach var="item" items="${pageSizeSelectList}">
			<option value="${item}" ${page.pageSize == item ? 'selected' : '' }>${item}</option>
		</c:forEach>
	</select>条&nbsp;
</c:if>
共${page.totalCount}条
